
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="zh-cn" xmlns="http://www.w33.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
	<title>商品列表</title>
	<link rel="stylesheet" type="text/css" href="css/search.css" charset=utf-8>
	
</head>
<body>
	<?php
	require 'top.php';
	// <!-- 引用了top。php，就不用启动session等功能 -->
	?>

	<div class="box clearfix">
		<div class="cont">
			<?php 
			$sqlhot="SELECT * FROM hotsearch ORDER BY searchid DESC";
			$resulthot=mysqli_query($config,$sqlhot) or die ('SQL语句有误:'.mysql_error());
			for($i=0;$i<8;$i++){
				$field=$rowhot['searchname'];
	       if($field!=""){
	       	$sql="SELECT * FROM goods WHERE goodsname like '%$field%' OR xinghao like '%$field%' OR intro like '%$field%' OR picture like '%$field%' OR detail like '%$field%' OR zhuangtai like '%$field%' AND state='0'";
	       	$result = mysqli_query($config,$sql) or die ('SQL语句有误：'.mysqli_error());
	       	?>
	       
			<ul>
				<?php while ($ro=mysqli_fetch_array($result)){?>
					<li>
						<a href="detail.php?key_id=<?php echo $ro['goodsid'];?>">
							<div class="img" >
								<img src="images/goods/<?php echo $ro['bigtypeid'];?>/<?php echo $ro['smalltypeid'];?>/<?php echo $ro['picture'];?>">
								<p>
									￥<span style="font-weight: 700;"><?php echo $ro['price'];?></span>
									<i></i>
									<span ><s>￥<?php echo $ro['yuanjia'];?></s></span>
									<i></i>
									<span><?php echo $ro['leixing'];?></span>
									<i></i>
									<span><?php echo $ro['zhuangtai'];?></span>
								</p>
							</div>
							<div class="list">
								<h1><?php echo $ro['goodsname'];?></h1>
							</div>
						</a>
					</li>
				<?php } ?>
			</ul>
		    <?php } 
		    $resulthot++;
		    $rowhot=mysqli_fetch_array($resulthot);
			}
			?>
		</div>

	</div>






</body>
</html>